words = ['apple', 'banana', 'cherry', 'date']
sorted_words = sorted(words, key=len)
print(sorted_words)  # 输出：['date', 'apple', 'banana', 'cherry']